A simple statement cannot be decomposed in separate statements. There are basically 4 kinds of simple statements:
Simple statements
Of these statements, the raise statement will be explained in the
chapter on Exceptions (chapter ())
Assignments give a value to a variable, replacing any previous value the observable might have had:
Assignments
In addition to the standard Pascal assignment operator ( := ), which
simply replaces the value of the varable with the value resulting from the
expression on the right of the := operator, Free Pascal
supports some c-style constructions. All available constructs are listed in
table ().
Assignment | Result |
a += b | Adds b to a, and stores the result in a. |
a -= b | Substracts b from a, and stores the result in a. |
a *= b | Multiplies a with b, and stores the result in a. |
a /= b | Divides a through b, and stores the result in a. |
For these constructs to work, you should specify the -Sc command-line switch.
Remark: These constructions are just for typing convenience, they don't generate different code.
Here are some examples of valid assignment statements:
Procedure statements are calls to subroutines. There are different possibilities for procedure calls: A normal procedure call, an object method call (qualified or not) , or even a call to a procedural type variable. All types are present in the following diagram.
Procedure statements
The Free Pascal compiler will look for a procedure with the same name as given in the procedure statement, and with a declared parameter list that matches the actual parameter list.
The following are valid procedure statements:
Free Pascal supports the goto jump statement. Its prototype syntax is
Goto statement
When using goto statements, you must keep the following in mind:
For instance, the following is an allowed goto statement: